<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>jQuery 实现Ajax跨域请求</title>
	<script src="../lib/jquery-1.12.1.min.js"></script>
</head>
<body>

    <!--<img src="https://www.baidu.com/img/bd_logo1.png">-->
    <!--<iframe src="" frameborder="0"></iframe>-->
    <!--<script src=""></script>-->

    <hr>

	<button id="requestBtn">发送Ajax请求</button>


	<script>

		$('#requestBtn').on('click', function() {

			var url = "http://localhost/wbc/userMng/server/ajaxUserList.php?callback=?";

			$.ajax({
				type: 'get',
				url: url,
				data: {size: 5},
				dataType: 'json',
				success: function(response) {
					console.log(response);
				},
				error: function() {

				}
			});

			/*$.getJSON(url, function(response) {
				console.log(response);
			});*/

			/*$.get(url, {}, function(response) {
				console.log(response);
			}, 'json');*/

			/*$.get(url, function(response) {

				console.log(response);

			});*/


			///////////////////////////////////////////////

            /*var url = "http://localhost/wbc/userMng/server/ajaxUserList.php?callback=?";

            $.ajax({
                type: 'get',
                url: url,
                data: {size: 5},
                dataType: 'json',
                success: function(response) {
                    console.log(response);
                },
                error: function() {

                }
            });*/

            /*$.getJSON(url, function(response) {

                console.log(response);

            });*/

            /*$.post(url, {}, function() {

            }, 'json');*/

            /*$.get(url, {}, function(response) {

                console.log(response);
                // TODO

            }, 'json');*/

            /////////////////////////////////////////////////////////////

		});
	</script>
</body>
</html>